import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Element from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import VueCookies from 'vue-cookies'
Vue.use(VueCookies);

Vue.use(Element, { size: 'mini', zIndex: 3000 });

import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard);

Vue.config.productionTip = false

//修复jquery
var fn = $.ajax;
$.ajax = function (args) {
  args.url = Env.ApiUrl + args.url;
  args.headers = args.headers || {};
  args.headers['bpm-token'] = localStorage.getItem("bpm-token")

  // if((args.method || 'get').toLowerCase() === 'post'){
  //     args.contentType = 'application/json';
  // }
  return fn(args);
};

// var domain =
Vue.prototype.$cookies.config(24*3600*1000, "/");

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
